/*
 * multimon_utils.h
 *
 *  Created on: 19/08/2013
 *      Author: Alejandro Santos LU4EXT
 *
 *  Borrowed code from "multimon", by Thomas Sailer (sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu).
 */
/*
 *      multimon.h -- Monitor for many different modulation formats
 *
 *      Copyright (C) 1996
 *          Thomas Sailer (sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu)
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <cstdio>
#include <cstdarg>

int verbprintf(int log_level, const char* fmt, ...) {
#ifndef __COVERITY__ 
	(void)log_level;
	va_list vl;
	va_start(vl, fmt);
	return vfprintf(stderr, fmt, vl);
#else
	return 0;
#endif
}


/*
 * This file is machine generated, DO NOT EDIT!
 * PS: Not exactly anymore.
 */

float costabf[1024] = {
	 1.000000000f,  0.999981165f,  0.999924719f,  0.999830604f,
	 0.999698818f,  0.999529421f,  0.999322355f,  0.999077737f,
	 0.998795450f,  0.998475552f,  0.998118103f,  0.997723043f,
	 0.997290432f,  0.996820271f,  0.996312618f,  0.995767415f,
	 0.995184720f,  0.994564593f,  0.993906975f,  0.993211925f,
	 0.992479563f,  0.991709769f,  0.990902662f,  0.990058184f,
	 0.989176512f,  0.988257587f,  0.987301409f,  0.986308098f,
	 0.985277653f,  0.984210074f,  0.983105481f,  0.981963873f,
	 0.980785251f,  0.979569793f,  0.978317380f,  0.977028131f,
	 0.975702107f,  0.974339366f,  0.972939968f,  0.971503913f,
	 0.970031261f,  0.968522072f,  0.966976464f,  0.965394437f,
	 0.963776052f,  0.962121427f,  0.960430503f,  0.958703458f,
	 0.956940353f,  0.955141187f,  0.953306019f,  0.951435030f,
	 0.949528158f,  0.947585583f,  0.945607305f,  0.943593442f,
	 0.941544056f,  0.939459205f,  0.937339008f,  0.935183525f,
	 0.932992816f,  0.930766940f,  0.928506076f,  0.926210225f,
	 0.923879504f,  0.921514034f,  0.919113874f,  0.916679084f,
	 0.914209783f,  0.911706030f,  0.909168005f,  0.906595707f,
	 0.903989315f,  0.901348829f,  0.898674488f,  0.895966232f,
	 0.893224299f,  0.890448749f,  0.887639642f,  0.884797096f,
	 0.881921291f,  0.879012227f,  0.876070082f,  0.873094976f,
	 0.870086968f,  0.867046237f,  0.863972843f,  0.860866964f,
	 0.857728601f,  0.854557991f,  0.851355195f,  0.848120332f,
	 0.844853580f,  0.841554999f,  0.838224709f,  0.834862888f,
	 0.831469595f,  0.828045070f,  0.824589312f,  0.821102500f,
	 0.817584813f,  0.814036310f,  0.810457170f,  0.806847572f,
	 0.803207517f,  0.799537241f,  0.795836926f,  0.792106569f,
	 0.788346410f,  0.784556568f,  0.780737221f,  0.776888490f,
	 0.773010433f,  0.769103348f,  0.765167236f,  0.761202395f,
	 0.757208824f,  0.753186822f,  0.749136388f,  0.745057762f,
	 0.740951121f,  0.736816585f,  0.732654274f,  0.728464365f,
	 0.724247098f,  0.720002532f,  0.715730846f,  0.711432219f,
	 0.707106769f,  0.702754736f,  0.698376238f,  0.693971455f,
	 0.689540565f,  0.685083687f,  0.680601001f,  0.676092684f,
	 0.671558976f,  0.666999936f,  0.662415802f,  0.657806695f,
	 0.653172851f,  0.648514390f,  0.643831551f,  0.639124453f,
	 0.634393275f,  0.629638255f,  0.624859512f,  0.620057225f,
	 0.615231574f,  0.610382795f,  0.605511069f,  0.600616455f,
	 0.595699310f,  0.590759695f,  0.585797846f,  0.580813944f,
	 0.575808167f,  0.570780754f,  0.565731823f,  0.560661554f,
	 0.555570245f,  0.550457954f,  0.545324981f,  0.540171444f,
	 0.534997642f,  0.529803634f,  0.524589658f,  0.519356012f,
	 0.514102757f,  0.508830130f,  0.503538370f,  0.498227656f,
	 0.492898196f,  0.487550169f,  0.482183784f,  0.476799220f,
	 0.471396744f,  0.465976506f,  0.460538715f,  0.455083579f,
	 0.449611336f,  0.444122136f,  0.438616246f,  0.433093816f,
	 0.427555084f,  0.422000259f,  0.416429549f,  0.410843164f,
	 0.405241311f,  0.399624199f,  0.393992037f,  0.388345033f,
	 0.382683426f,  0.377007425f,  0.371317208f,  0.365612984f,
	 0.359895051f,  0.354163527f,  0.348418683f,  0.342660725f,
	 0.336889863f,  0.331106305f,  0.325310290f,  0.319502026f,
	 0.313681751f,  0.307849646f,  0.302005947f,  0.296150893f,
	 0.290284663f,  0.284407526f,  0.278519690f,  0.272621363f,
	 0.266712755f,  0.260794103f,  0.254865646f,  0.248927608f,
	 0.242980182f,  0.237023607f,  0.231058106f,  0.225083917f,
	 0.219101235f,  0.213110313f,  0.207111374f,  0.201104641f,
	 0.195090324f,  0.189068660f,  0.183039889f,  0.177004218f,
	 0.170961887f,  0.164913118f,  0.158858150f,  0.152797192f,
	 0.146730468f,  0.140658244f,  0.134580702f,  0.128498107f,
	 0.122410677f,  0.116318628f,  0.110222206f,  0.104121633f,
	 0.098017141f,  0.091908954f,  0.085797310f,  0.079682440f,
	 0.073564567f,  0.067443922f,  0.061320737f,  0.055195246f,
	 0.049067676f,  0.042938258f,  0.036807224f,  0.030674804f,
	 0.024541229f,  0.018406730f,  0.012271538f,  0.006135885f,
	 0.000000000f, -0.006135885f, -0.012271538f, -0.018406730f,
	-0.024541229f, -0.030674804f, -0.036807224f, -0.042938258f,
	-0.049067676f, -0.055195246f, -0.061320737f, -0.067443922f,
	-0.073564567f, -0.079682440f, -0.085797310f, -0.091908954f,
	-0.098017141f, -0.104121633f, -0.110222206f, -0.116318628f,
	-0.122410677f, -0.128498107f, -0.134580702f, -0.140658244f,
	-0.146730468f, -0.152797192f, -0.158858150f, -0.164913118f,
	-0.170961887f, -0.177004218f, -0.183039889f, -0.189068660f,
	-0.195090324f, -0.201104641f, -0.207111374f, -0.213110313f,
	-0.219101235f, -0.225083917f, -0.231058106f, -0.237023607f,
	-0.242980182f, -0.248927608f, -0.254865646f, -0.260794103f,
	-0.266712755f, -0.272621363f, -0.278519690f, -0.284407526f,
	-0.290284663f, -0.296150893f, -0.302005947f, -0.307849646f,
	-0.313681751f, -0.319502026f, -0.325310290f, -0.331106305f,
	-0.336889863f, -0.342660725f, -0.348418683f, -0.354163527f,
	-0.359895051f, -0.365612984f, -0.371317208f, -0.377007425f,
	-0.382683426f, -0.388345033f, -0.393992037f, -0.399624199f,
	-0.405241311f, -0.410843164f, -0.416429549f, -0.422000259f,
	-0.427555084f, -0.433093816f, -0.438616246f, -0.444122136f,
	-0.449611336f, -0.455083579f, -0.460538715f, -0.465976506f,
	-0.471396744f, -0.476799220f, -0.482183784f, -0.487550169f,
	-0.492898196f, -0.498227656f, -0.503538370f, -0.508830130f,
	-0.514102757f, -0.519356012f, -0.524589658f, -0.529803634f,
	-0.534997642f, -0.540171444f, -0.545324981f, -0.550457954f,
	-0.555570245f, -0.560661554f, -0.565731823f, -0.570780754f,
	-0.575808167f, -0.580813944f, -0.585797846f, -0.590759695f,
	-0.595699310f, -0.600616455f, -0.605511069f, -0.610382795f,
	-0.615231574f, -0.620057225f, -0.624859512f, -0.629638255f,
	-0.634393275f, -0.639124453f, -0.643831551f, -0.648514390f,
	-0.653172851f, -0.657806695f, -0.662415802f, -0.666999936f,
	-0.671558976f, -0.676092684f, -0.680601001f, -0.685083687f,
	-0.689540565f, -0.693971455f, -0.698376238f, -0.702754736f,
	-0.707106769f, -0.711432219f, -0.715730846f, -0.720002532f,
	-0.724247098f, -0.728464365f, -0.732654274f, -0.736816585f,
	-0.740951121f, -0.745057762f, -0.749136388f, -0.753186822f,
	-0.757208824f, -0.761202395f, -0.765167236f, -0.769103348f,
	-0.773010433f, -0.776888490f, -0.780737221f, -0.784556568f,
	-0.788346410f, -0.792106569f, -0.795836926f, -0.799537241f,
	-0.803207517f, -0.806847572f, -0.810457170f, -0.814036310f,
	-0.817584813f, -0.821102500f, -0.824589312f, -0.828045070f,
	-0.831469595f, -0.834862888f, -0.838224709f, -0.841554999f,
	-0.844853580f, -0.848120332f, -0.851355195f, -0.854557991f,
	-0.857728601f, -0.860866964f, -0.863972843f, -0.867046237f,
	-0.870086968f, -0.873094976f, -0.876070082f, -0.879012227f,
	-0.881921291f, -0.884797096f, -0.887639642f, -0.890448749f,
	-0.893224299f, -0.895966232f, -0.898674488f, -0.901348829f,
	-0.903989315f, -0.906595707f, -0.909168005f, -0.911706030f,
	-0.914209783f, -0.916679084f, -0.919113874f, -0.921514034f,
	-0.923879504f, -0.926210225f, -0.928506076f, -0.930766940f,
	-0.932992816f, -0.935183525f, -0.937339008f, -0.939459205f,
	-0.941544056f, -0.943593442f, -0.945607305f, -0.947585583f,
	-0.949528158f, -0.951435030f, -0.953306019f, -0.955141187f,
	-0.956940353f, -0.958703458f, -0.960430503f, -0.962121427f,
	-0.963776052f, -0.965394437f, -0.966976464f, -0.968522072f,
	-0.970031261f, -0.971503913f, -0.972939968f, -0.974339366f,
	-0.975702107f, -0.977028131f, -0.978317380f, -0.979569793f,
	-0.980785251f, -0.981963873f, -0.983105481f, -0.984210074f,
	-0.985277653f, -0.986308098f, -0.987301409f, -0.988257587f,
	-0.989176512f, -0.990058184f, -0.990902662f, -0.991709769f,
	-0.992479563f, -0.993211925f, -0.993906975f, -0.994564593f,
	-0.995184720f, -0.995767415f, -0.996312618f, -0.996820271f,
	-0.997290432f, -0.997723043f, -0.998118103f, -0.998475552f,
	-0.998795450f, -0.999077737f, -0.999322355f, -0.999529421f,
	-0.999698818f, -0.999830604f, -0.999924719f, -0.999981165f,
	-1.000000000f, -0.999981165f, -0.999924719f, -0.999830604f,
	-0.999698818f, -0.999529421f, -0.999322355f, -0.999077737f,
	-0.998795450f, -0.998475552f, -0.998118103f, -0.997723043f,
	-0.997290432f, -0.996820271f, -0.996312618f, -0.995767415f,
	-0.995184720f, -0.994564593f, -0.993906975f, -0.993211925f,
	-0.992479563f, -0.991709769f, -0.990902662f, -0.990058184f,
	-0.989176512f, -0.988257587f, -0.987301409f, -0.986308098f,
	-0.985277653f, -0.984210074f, -0.983105481f, -0.981963873f,
	-0.980785251f, -0.979569793f, -0.978317380f, -0.977028131f,
	-0.975702107f, -0.974339366f, -0.972939968f, -0.971503913f,
	-0.970031261f, -0.968522072f, -0.966976464f, -0.965394437f,
	-0.963776052f, -0.962121427f, -0.960430503f, -0.958703458f,
	-0.956940353f, -0.955141187f, -0.953306019f, -0.951435030f,
	-0.949528158f, -0.947585583f, -0.945607305f, -0.943593442f,
	-0.941544056f, -0.939459205f, -0.937339008f, -0.935183525f,
	-0.932992816f, -0.930766940f, -0.928506076f, -0.926210225f,
	-0.923879504f, -0.921514034f, -0.919113874f, -0.916679084f,
	-0.914209783f, -0.911706030f, -0.909168005f, -0.906595707f,
	-0.903989315f, -0.901348829f, -0.898674488f, -0.895966232f,
	-0.893224299f, -0.890448749f, -0.887639642f, -0.884797096f,
	-0.881921291f, -0.879012227f, -0.876070082f, -0.873094976f,
	-0.870086968f, -0.867046237f, -0.863972843f, -0.860866964f,
	-0.857728601f, -0.854557991f, -0.851355195f, -0.848120332f,
	-0.844853580f, -0.841554999f, -0.838224709f, -0.834862888f,
	-0.831469595f, -0.828045070f, -0.824589312f, -0.821102500f,
	-0.817584813f, -0.814036310f, -0.810457170f, -0.806847572f,
	-0.803207517f, -0.799537241f, -0.795836926f, -0.792106569f,
	-0.788346410f, -0.784556568f, -0.780737221f, -0.776888490f,
	-0.773010433f, -0.769103348f, -0.765167236f, -0.761202395f,
	-0.757208824f, -0.753186822f, -0.749136388f, -0.745057762f,
	-0.740951121f, -0.736816585f, -0.732654274f, -0.728464365f,
	-0.724247098f, -0.720002532f, -0.715730846f, -0.711432219f,
	-0.707106769f, -0.702754736f, -0.698376238f, -0.693971455f,
	-0.689540565f, -0.685083687f, -0.680601001f, -0.676092684f,
	-0.671558976f, -0.666999936f, -0.662415802f, -0.657806695f,
	-0.653172851f, -0.648514390f, -0.643831551f, -0.639124453f,
	-0.634393275f, -0.629638255f, -0.624859512f, -0.620057225f,
	-0.615231574f, -0.610382795f, -0.605511069f, -0.600616455f,
	-0.595699310f, -0.590759695f, -0.585797846f, -0.580813944f,
	-0.575808167f, -0.570780754f, -0.565731823f, -0.560661554f,
	-0.555570245f, -0.550457954f, -0.545324981f, -0.540171444f,
	-0.534997642f, -0.529803634f, -0.524589658f, -0.519356012f,
	-0.514102757f, -0.508830130f, -0.503538370f, -0.498227656f,
	-0.492898196f, -0.487550169f, -0.482183784f, -0.476799220f,
	-0.471396744f, -0.465976506f, -0.460538715f, -0.455083579f,
	-0.449611336f, -0.444122136f, -0.438616246f, -0.433093816f,
	-0.427555084f, -0.422000259f, -0.416429549f, -0.410843164f,
	-0.405241311f, -0.399624199f, -0.393992037f, -0.388345033f,
	-0.382683426f, -0.377007425f, -0.371317208f, -0.365612984f,
	-0.359895051f, -0.354163527f, -0.348418683f, -0.342660725f,
	-0.336889863f, -0.331106305f, -0.325310290f, -0.319502026f,
	-0.313681751f, -0.307849646f, -0.302005947f, -0.296150893f,
	-0.290284663f, -0.284407526f, -0.278519690f, -0.272621363f,
	-0.266712755f, -0.260794103f, -0.254865646f, -0.248927608f,
	-0.242980182f, -0.237023607f, -0.231058106f, -0.225083917f,
	-0.219101235f, -0.213110313f, -0.207111374f, -0.201104641f,
	-0.195090324f, -0.189068660f, -0.183039889f, -0.177004218f,
	-0.170961887f, -0.164913118f, -0.158858150f, -0.152797192f,
	-0.146730468f, -0.140658244f, -0.134580702f, -0.128498107f,
	-0.122410677f, -0.116318628f, -0.110222206f, -0.104121633f,
	-0.098017141f, -0.091908954f, -0.085797310f, -0.079682440f,
	-0.073564567f, -0.067443922f, -0.061320737f, -0.055195246f,
	-0.049067676f, -0.042938258f, -0.036807224f, -0.030674804f,
	-0.024541229f, -0.018406730f, -0.012271538f, -0.006135885f,
	-0.000000000f,  0.006135885f,  0.012271538f,  0.018406730f,
	 0.024541229f,  0.030674804f,  0.036807224f,  0.042938258f,
	 0.049067676f,  0.055195246f,  0.061320737f,  0.067443922f,
	 0.073564567f,  0.079682440f,  0.085797310f,  0.091908954f,
	 0.098017141f,  0.104121633f,  0.110222206f,  0.116318628f,
	 0.122410677f,  0.128498107f,  0.134580702f,  0.140658244f,
	 0.146730468f,  0.152797192f,  0.158858150f,  0.164913118f,
	 0.170961887f,  0.177004218f,  0.183039889f,  0.189068660f,
	 0.195090324f,  0.201104641f,  0.207111374f,  0.213110313f,
	 0.219101235f,  0.225083917f,  0.231058106f,  0.237023607f,
	 0.242980182f,  0.248927608f,  0.254865646f,  0.260794103f,
	 0.266712755f,  0.272621363f,  0.278519690f,  0.284407526f,
	 0.290284663f,  0.296150893f,  0.302005947f,  0.307849646f,
	 0.313681751f,  0.319502026f,  0.325310290f,  0.331106305f,
	 0.336889863f,  0.342660725f,  0.348418683f,  0.354163527f,
	 0.359895051f,  0.365612984f,  0.371317208f,  0.377007425f,
	 0.382683426f,  0.388345033f,  0.393992037f,  0.399624199f,
	 0.405241311f,  0.410843164f,  0.416429549f,  0.422000259f,
	 0.427555084f,  0.433093816f,  0.438616246f,  0.444122136f,
	 0.449611336f,  0.455083579f,  0.460538715f,  0.465976506f,
	 0.471396744f,  0.476799220f,  0.482183784f,  0.487550169f,
	 0.492898196f,  0.498227656f,  0.503538370f,  0.508830130f,
	 0.514102757f,  0.519356012f,  0.524589658f,  0.529803634f,
	 0.534997642f,  0.540171444f,  0.545324981f,  0.550457954f,
	 0.555570245f,  0.560661554f,  0.565731823f,  0.570780754f,
	 0.575808167f,  0.580813944f,  0.585797846f,  0.590759695f,
	 0.595699310f,  0.600616455f,  0.605511069f,  0.610382795f,
	 0.615231574f,  0.620057225f,  0.624859512f,  0.629638255f,
	 0.634393275f,  0.639124453f,  0.643831551f,  0.648514390f,
	 0.653172851f,  0.657806695f,  0.662415802f,  0.666999936f,
	 0.671558976f,  0.676092684f,  0.680601001f,  0.685083687f,
	 0.689540565f,  0.693971455f,  0.698376238f,  0.702754736f,
	 0.707106769f,  0.711432219f,  0.715730846f,  0.720002532f,
	 0.724247098f,  0.728464365f,  0.732654274f,  0.736816585f,
	 0.740951121f,  0.745057762f,  0.749136388f,  0.753186822f,
	 0.757208824f,  0.761202395f,  0.765167236f,  0.769103348f,
	 0.773010433f,  0.776888490f,  0.780737221f,  0.784556568f,
	 0.788346410f,  0.792106569f,  0.795836926f,  0.799537241f,
	 0.803207517f,  0.806847572f,  0.810457170f,  0.814036310f,
	 0.817584813f,  0.821102500f,  0.824589312f,  0.828045070f,
	 0.831469595f,  0.834862888f,  0.838224709f,  0.841554999f,
	 0.844853580f,  0.848120332f,  0.851355195f,  0.854557991f,
	 0.857728601f,  0.860866964f,  0.863972843f,  0.867046237f,
	 0.870086968f,  0.873094976f,  0.876070082f,  0.879012227f,
	 0.881921291f,  0.884797096f,  0.887639642f,  0.890448749f,
	 0.893224299f,  0.895966232f,  0.898674488f,  0.901348829f,
	 0.903989315f,  0.906595707f,  0.909168005f,  0.911706030f,
	 0.914209783f,  0.916679084f,  0.919113874f,  0.921514034f,
	 0.923879504f,  0.926210225f,  0.928506076f,  0.930766940f,
	 0.932992816f,  0.935183525f,  0.937339008f,  0.939459205f,
	 0.941544056f,  0.943593442f,  0.945607305f,  0.947585583f,
	 0.949528158f,  0.951435030f,  0.953306019f,  0.955141187f,
	 0.956940353f,  0.958703458f,  0.960430503f,  0.962121427f,
	 0.963776052f,  0.965394437f,  0.966976464f,  0.968522072f,
	 0.970031261f,  0.971503913f,  0.972939968f,  0.974339366f,
	 0.975702107f,  0.977028131f,  0.978317380f,  0.979569793f,
	 0.980785251f,  0.981963873f,  0.983105481f,  0.984210074f,
	 0.985277653f,  0.986308098f,  0.987301409f,  0.988257587f,
	 0.989176512f,  0.990058184f,  0.990902662f,  0.991709769f,
	 0.992479563f,  0.993211925f,  0.993906975f,  0.994564593f,
	 0.995184720f,  0.995767415f,  0.996312618f,  0.996820271f,
	 0.997290432f,  0.997723043f,  0.998118103f,  0.998475552f,
	 0.998795450f,  0.999077737f,  0.999322355f,  0.999529421f,
	 0.999698818f,  0.999830604f,  0.999924719f,  0.999981165f
};


